<?php $this->display("objects/breadcrumbs") ?>

<h2><?php _e($object['title']) ?></h2>
<p id="objdesc"><strong><?php _e($object['description']) ?></strong></p>

<?php echo $object['content'] ?>

<table class="smart">
<tr><td class="forums">
<h3>Forums</h3>

<?php if (count($childs)): ?>
	<table>
	<?php foreach ($childs as $i): ?>
		<?php if (checkPermission($i, "view")): ?>
			<tr class="<?php if ($i['unread']): ?>unread<?php else: ?>read<?php endif; ?>"><td class="icon"><a href="<?php echo Gene::makeLink($i) ?>">
			<?php if ($i['unread']): ?>
				<?php if ($i['icon_new']): ?>
					<img src="<?php echo Gene::makeLink(Gene::fileId($i['icon_new'])) ?>" alt="" width="50" height="50" />
				<?php else: ?>
					<img src="<?php echo $ui['images'] ?>unread.png" alt="" width="50" height="50" />
				<?php endif; ?>
			<?php else: ?>
				<?php if ($i['icon_nonew']): ?>
					<img src="<?php echo Gene::makeLink(Gene::fileId($i['icon_nonew'])) ?>" alt="" width="50" height="50" />
				<?php else: ?>
					<img src="<?php echo $ui['images'] ?>read.png" alt="" width="50" height="50" />
				<?php endif; ?>
			<?php endif; ?></a>
			</td><td>
			<a class="forumname" href="<?php echo Gene::makeLink($i) ?>"><?php _e($i['title']) ?></a><br />
			<span class="forumdescription"><?php _e($i['description']) ?></span><br />
			<span class="forumdcount"><?php echo $i['numchilds'] ?> discussions</span></td></tr>
		<?php endif; ?>
	<?php endforeach; ?>
	</table>
<?php else: ?>
	<p><em>You have no favourite forums yet!</em></p>
<?php endif; ?>

<p><a href="<?php echo Gene::makeLink($object) ?>/view/list">View all forums...</a></p>
</div>
</td><td class="discussions">

<?php if (count($featured)): ?>
	<h3>Discussions</h3>
<?php endif; ?>

<?php if (count($recent)): ?>
	<h3>Viewed Discussions</h3>

	<table>
	<?php foreach($recent as $i): ?>
		<tr <?php if ($i['comments'] <= $i['numchilds']): ?>class="unread"<?php endif; ?>>
		<td class="icon"><a href="<?php echo Gene::makeLink($i) ?>">
		<?php if ($i['comments'] <= $i['numchilds']): ?>
			<?php if ($i['icon_new']): ?>
				<img src="<?php echo Gene::makeLink(Gene::fileId($i['icon_new'])) ?>" alt="" width="50" height="50" />
			<?php else: ?>
				<img src="<?php echo $ui['images'] ?>unread.png" alt="" width="50" height="50" />
			<?php endif; ?>
		<?php else: ?>
			<?php if ($i['icon_nonew']): ?>
				<img src="<?php echo Gene::makeLink(Gene::fileId($i['icon_nonew'])) ?>" alt="" width="50" height="50" />
			<?php else: ?>
				<img src="<?php echo $ui['images'] ?>read.png" alt="" width="50" height="50" />
			<?php endif; ?>
		<?php endif; ?>
		</a></td><td>
		<a href="<?php echo Gene::makeLink($i) ?><?php if ($i['comments'] <= $i['numchilds']): ?>/view/unread<?php endif; ?>" class="discussionname"><?php _e($i['title']) ?></a>
		<br /><span class="discussiondescription"><?php if ($i['owner_id']): ?><? _e($i['name']) ?><?php else: ?>"<?php _e($i['guest_name']) ?>"<?php endif; ?>: "<?php echo $i['excerpt'] ?>"</span></td></tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

<h3>My Account</h3>

<p><a href="<?php echo Gene::makeLink($object) ?>/view/list">Show Classic View</a></p>

<p><a href="<?php echo Gene::makeLink($object) ?>/view/preferences">Preferences</a></p>

<p><a href="<?php echo Gene::makeLink(Gene::userId($member['name'])) ?>/edit">Edit Profile</a></p>

<p><a href="<?php echo addArguments(Gene::makeLink(Gene::specialId('Logout')), array('r' => $objectid)) ?>">Sign Out</a></p>


</td></tr></table>

<?php if (checkPermission($object, "write")): ?>
	<?php $this->display("objects/forum/create"); ?>
<?php endif; ?>